package com.cn.jinl.domain;

import com.cn.jinl.utils.CommonUtil;
import com.google.common.collect.ImmutableMap;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;
import java.util.Map;

public class BoxManage {
    private String boxCode;

    private String printCode;

    private String codeStatus;

    private String printUserName;

    private String printTime;

    private String userName;

    private Date createTime;

    private Date updateTime;

    private String status;

    private String voidName;
    private Date voidTime;

    private int count;

    public static final transient Map<String, String> STATUSCODEMAP =
            ImmutableMap.of("0", "未使用", "1", "已使用","2","已作废");

    public String getBoxCode() {
        return boxCode;
    }

    public void setBoxCode(String boxCode) {
        this.boxCode = boxCode == null ? null : boxCode.trim();
    }

    public String getPrintCodeCn() {
        return STATUSCODEMAP.get(getPrintCode());
    }
    public String getPrintCode() {
        return printCode;
    }

    public void setPrintCode(String printCode) {
        this.printCode = printCode == null ? null : printCode.trim();
    }

    public String getCodeStatusCn() {
        if(StringUtils.equals("1",getCodeStatus())){
            return "生产已入库";
        }else if(StringUtils.equals("2",getCodeStatus())){
            return "整理已入库";
        }else if(StringUtils.equals("3",getCodeStatus())){
            return "退货已入库";
        }else if(StringUtils.equals("4",getCodeStatus())){
            return "销售已入库";
        }else if(StringUtils.equals("5",getCodeStatus())){
            return "报废已入库";
        }else if(StringUtils.equals("6",getCodeStatus())){
            return "订单已出库";
        } else if(StringUtils.equals("7",getCodeStatus())){
            return "清理已出库";
        }else if(StringUtils.isNotBlank(getPrintTime())){
            return "已打印";
        }
        return "待打印";
    }
    public String getCodeStatus() {
        return codeStatus;
    }

    public void setCodeStatus(String codeStatus) {
        this.codeStatus = codeStatus == null ? null : codeStatus.trim();
    }

    public String getPrintUserName() {
        return printUserName;
    }

    public void setPrintUserName(String printUserName) {
        this.printUserName = printUserName == null ? null : printUserName.trim();
    }

    public String getPrintTime() {
        return printTime;
    }

    public void setPrintTime(String printTime) {
        this.printTime = printTime == null ? null : printTime.trim();
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status == null ? null : status.trim();
    }

    public int getCount() {
        return count;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public String getCreateTimeFt(){
        String formatTime = CommonUtil.getStrTime(getCreateTime(),"yyyy-MM-dd HH:mm:ss");
        return formatTime;
    }

    public String getVoidTimeFt(){
        String formatTime = CommonUtil.getStrTime(getVoidTime(),"yyyy-MM-dd HH:mm:ss");
        return formatTime;
    }
    public String getVoidName() {
        return voidName;
    }

    public void setVoidName(String voidName) {
        this.voidName = voidName;
    }

    public Date getVoidTime() {
        return voidTime;
    }

    public void setVoidTime(Date voidTime) {
        this.voidTime = voidTime;
    }
}